define(function (require, exports, module) {



    var _ = require("http://localhost:8180//git-my/vue-ladder/src/lib/lodash.js");


    Vue.use(VueRouter);


    function GetUrlParamsMap() {
        var url = location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }

    var cubeId = GetUrlParamsMap()['cubeId'];



    var router = [{
        path: '/',
        redirect: '/cube-collection/' + cubeId
        // component: function (resolve) {
        //     require.async(['modules/side-tree/index.js'], resolve);
        // }
    },
    {
        path: '/cube-list/:curCubeId',
        name: 'list',
        component: function (resolve) {
            require.async(['modules/cube-list/index.js'], resolve);
        }
    },
    {
        path: '/cube-collection/:curCubeId',
        name: 'first',
        component: function (resolve) {
            require.async(['modules/cube-collection/index.js'], resolve);
        }
    },
    {
        path: '/cube-basic-info',
        component: function (resolve) {
            require.async(['modules/cube-basic-info/index.js'], resolve);
        }
    },
    {
        path: '/cube-props/:curCubeId',
        component: function (resolve) {
            require.async(['modules/cube-props/index.js'], resolve);
        }
    },
    {
        path: '/cube-methods',
        component: function (resolve) {
            require.async(['modules/cube-methods/index.js'], resolve);
        }
    },
    {
        path: '/cube-api',
        component: function (resolve) {
            require.async(['modules/cube-api-list/index.js'], resolve);
        }
    },

    {
        path: '/table2/:curCubeId',
        name: 'log',
        component: function (resolve) {
            require.async(['modules/table2/index.js'], resolve);
        }
    }, {
        path: '/update/:userId',
        component: function (resolve) {
            require.async(['modules/update/index.js'], resolve);
        }
    }]


    //创建一个路由器实例
    var router = new VueRouter({
        routes: router,
    });

    //cubeId=1001;

    var app = new Vue({
        router: router,
        data: {
            arr: [{
                to: '/cube-collection/' + cubeId,
                text: '基本信息'
            }, {
                to: '/table2/' + cubeId,
                text: '日志'
            }]
        },
        methods: {
            navClick: function (index) {
            },
            handleCompareClick: function (currentVerion, lastVerion) {
                //默认与上一个版本对比  或 指定 上个版本
                alert("待完善");
            }
        },
        mounted: function () {

        }

    }).$mount('#app')


    // 关键在这里，设置afterEach钩子函数
    router.afterEach((to, from, next) => {
        console.log("to:" + to + ",from:" + from);
    })


});